]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
inhibitShortcutsDialog: Adapt to new dialog design
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 27 Jan 2020 21:49:36 +0000 (22:49 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 27 Jan 2020 22:40:04 +0000 (23:40 +0100)
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/962

data/theme/gnome-shell-sass/widgets/_dialogs.scss
js/ui/inhibitShortcutsDialog.js

index bdc19feb8bdca6f1532c8996842fe6f4cf90a4f9..cf0575e1ca4855de0b55b0e2023647cf2958737e 100644 (file)
   spacing: 30px;
 }
 
-/* Inhibit-Shortcuts Dialog */
-.inhibit-shortcuts-dialog {
-  spacing: 30px;
-}
-
 /* Network Agent Dialog */
 
 .network-dialog-secret-table {
index 2ef2d04ed717099bdc74f5245166ec7649d179c5..14731daa5ac84a443a235a6f88697ae40f7e0eda 100644 (file)
@@ -1,5 +1,5 @@
 /* exported InhibitShortcutsDialog */
-const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
 
 const Dialog = imports.ui.dialog;
 const ModalDialog = imports.ui.modalDialog;
@@ -75,22 +75,25 @@ var InhibitShortcutsDialog = GObject.registerClass({
     _buildLayout() {
         let name = this._app ? this._app.get_name() : this._window.title;
 
-        /* Translators: %s is an application name like "Settings" */
-        let title = name
-            ? _("%s wants to inhibit shortcuts").format(name)
-            : _("Application wants to inhibit shortcuts");
-
-        let contentParams = { title };
+        let content = new Dialog.MessageDialogContent({
+            title: _('Allow inhibiting shortcuts'),
+            description: name
+                /* Translators: %s is an application name like "Settings" */
+                ? _('The application %s wants to inhibit shortcuts').format(name)
+                : _('An application wants to inhibit shortcuts'),
+        });
 
         let restoreAccel = this._getRestoreAccel();
         if (restoreAccel) {
-            contentParams.description =
+            let restoreLabel = new St.Label({
                 /* Translators: %s is a keyboard shortcut like "Super+x" */
-                _("You can restore shortcuts by pressing %s.").format(restoreAccel);
+                text: _('You can restore shortcuts by pressing %s.').format(restoreAccel),
+                style_class: 'message-dialog-description',
+            });
+            content.add_child(restoreLabel);
         }
 
-        let content = new Dialog.MessageDialogContent(contentParams);
-        this._dialog.contentLayout.add_actor(content);
+        this._dialog.contentLayout.add_child(content);
 
         this._dialog.addButton({ label: _("Deny"),
                                  action: () => {